<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>表单组合</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="__STATIC__/extends/AmazeUI-2.7.2/css/amazeui.css">
    <link href="__STATIC__/css/base.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="__STATIC__/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="__STATIC__/layuiadmin/style/admin.css" media="all">

    <script src="__STATIC__/js/jquery-1.8.3.min.js"></script>
    <script src="__STATIC__/extends/AmazeUI-2.7.2/js/amazeui.min.js"></script>

    <link rel="stylesheet" href="__STATIC__/css/seller.css">
    <link rel="stylesheet" href="__STATIC__/css/seller_goods.css">
    <script src="__STATIC__/js/common1.js"></script>
</head>
<body>

<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-header">{$group_one?'编辑':'添加'}筛选组</div>
        <div class="layui-card-body" style="padding: 15px;">
            {if $group_one}
            <form class="layui-form" action="{:url('edit')}" method="post" lay-filter="component-form-group">
             <input type="hidden" name="group_id" value="{$group_id}">
            {else/}
            <form class="layui-form" action="{:url('add')}" method="post" lay-filter="component-form-group">
            {/if}
                <div class="layui-form-item">
                    <label class="layui-form-label">筛选组名称：</label>
                    <div class="layui-input-block formControls">
                        <input type="text"  lay-verify="title" autocomplete="off" placeholder="筛选组名称不能为空！"  name="group_name" value="{$group_one['group_name']}"  {if empty($group_one)} datatype="*" nullmsg="筛选组英文名称不能为空！" ajaxurl="{:url('Attr/ajaxGroupName')}" {else/} datatype="*" nullmsg="筛选组名称不能为空！" ajaxurl="{:url('attr/ajaxGroupName',array('group_id'=>$group_one['group_id']))}" {/if}class="layui-input">
                        <span class="Validform_checktip"></span>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">自定义筛选ID：</label>
                    <div class="layui-input-block formControls">
                        <input type="text"  lay-verify="title" autocomplete="off" placeholder="自定义筛选ID名称不能为空！"  name="screenid" value="{$group_one['screenid']}" {if empty($group_one)} datatype="*" nullmsg="自定义筛选ID名称不能为空！" ajaxurl="{:url('Attr/ajaxScreenName')}" {else/} datatype="*" nullmsg="筛选组名称不能为空！" ajaxurl="{:url('attr/ajaxScreenName',array('group_id'=>$group_one['group_id']))}" {/if} class="layui-input">
                        <span class="Validform_checktip"></span>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">筛选组描述：</label>
                    <div class="layui-input-block">
                        <textarea type="text" lay-verify="description" class="layui-textarea" autocomplete="off" placeholder="筛选组描述不能为空"  name="description" >{$group_one['description']}</textarea>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">筛选组排序：</label>
                    <div class="layui-input-block">
                        <input type="text"  name="group_sort"  {if $group_one['group_sort'] neq ''} value="{$group_one['group_sort']}" {else/} value="50" {/if} datatype="*" nullmsg="筛选组排序不能为空！" lay-verify="title" autocomplete="off" placeholder="请输入用户名" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">是否开启：</label>
                    <div class="layui-input-block">
                        <input type="radio" name="group_status" value="1" title="是" {$group_one.group_status==1?'checked':''}>
                        <input type="radio" name="group_status" value="0" title="否" {$group_one.group_status==0?'checked':''}>
                    </div>
                </div>

                <div class="layui-form-item layui-layout-admin">
                    <div class="layui-input-block">
                        <div class="layui-footer" style="left: 0;">
                            <button class="layui-btn" lay-submit="" lay-filter="component-form-demo1">立即提交</button>
                            <a href="{:url('attr/index')}" class="layui-btn layui-btn-primary">返回</a>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

<script src="__STATIC__/extends/layui2.4.5/layui.all.js "></script>
<script src="__STATIC__/extends/Validform/5.3.2/Validform.min.js "></script>
<script src="__STATIC__/extends/js/jquery-ui.js"></script>
<script type="text/javascript">
    $(function() {
        //表单验证
        $("form").Validform({
            tiptype:function(msg,o,cssctl){
                if(!o.obj.is("form")){
                    //默认表单
                    var objtip=o.obj.parents(".formControls").find(".Validform_checktip");
                    cssctl(objtip,o.type);
                    objtip.text(msg);
                }
            },
            showAllError:true
        })

    });
</script>
<script src="__STATIC__/layuiadmin/layui/layui.js"></script>
<script>
    layui.config({
        base: '__STATIC__/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form', 'laydate'], function(){
        var $ = layui.$
            ,admin = layui.admin
            ,element = layui.element
            ,layer = layui.layer
            ,laydate = layui.laydate
            ,form = layui.form;

        form.render(null, 'component-form-group');

        laydate.render({
            elem: '#LAY-component-form-group-date'
        });


    });
</script>
</body>
</html>
